<script lang="ts">
export default {
    name: 'Kanban',
}
</script>
<script setup lang="ts">
import { ref } from 'vue';
import AppFooter from "../components/Footer.vue";


const tableData = [
    {
        title: '问题1',
        statues: '未解决',
        add_time: '2024-01-01',
    },
    {
        title: '问题2',
        statues: '已解决',
        add_time: '2024-01-02',
    },
    {
        title: '问题3',
        statues: '未解决',
        add_time: '2024-01-03',
    },
]

function handleCancel() {
    console.log('cancel')
}

function handleConfirm(confirm: Function) {
    confirm();
    console.log('confirm')
}

</script>

<template>
    <div class="app">
        <div>
            <h1>看板</h1>
            <h2>关注的问题列表</h2>

            <el-table :data="tableData" style="width: 100%">
                <el-table-column prop="title" label="问题" />
                <el-table-column prop="statues" label="状态" />
                <!--编辑按钮-->
                <el-table-column label="操作" width="200">
                    <template #default>
                        <el-button type="primary" size="small">查看</el-button>
                        <!-- <el-button type="danger" size="small">取消跟进</el-button> -->
                        <el-popconfirm width="220" title="确定取消跟进？" @cancel="handleCancel">
                            <template #reference>
                                <el-button type="danger" size="small">取消跟进</el-button>
                            </template>
                            <template #actions="{ confirm, cancel }">
                                <el-button size="small" @click="cancel">继续跟进</el-button>
                                <el-button type="danger" size="small" @click="handleConfirm(confirm)">
                                    取消跟进
                                </el-button>
                            </template>
                        </el-popconfirm>
                    </template>
                </el-table-column>
            </el-table>

            <h2>近期火热问题</h2>

            <el-table :data="tableData" style="width: 100%">
                <el-table-column prop="title" label="Title" />
                <el-table-column prop="statues" label="Status" />
                <el-table-column prop="add_time" label="Add Time" />
                <!--编辑按钮-->
                <el-table-column label="操作" width="200">
                    <template #default>
                        <el-button type="primary" size="small">查看</el-button>
                    </template>
                </el-table-column>
            </el-table>

            <h2>待处理问题</h2>

            <el-table :data="tableData" style="width: 100%">
                <el-table-column prop="title" label="Title" />
                <el-table-column prop="statues" label="Status" />
                <el-table-column prop="add_time" label="Add Time" />
                <!--编辑按钮-->
                <el-table-column label="操作" width="200">
                    <template #default>
                        <el-button type="primary" size="small">查看</el-button>
                    </template>
                </el-table-column>
            </el-table>

        </div>
        <app-footer />
    </div>
</template>

<style scoped></style>
